//
//  GoodsLogisticsFirstTableViewCell.m
//  quxiangtao
//
//  Created by xbmios on 2018/7/18.
//  Copyright © 2018年 shanhaijin. All rights reserved.
//

#import "GoodsLogisticsFirstTableViewCell.h"

@interface GoodsLogisticsFirstTableViewCell ()

@property (strong, nonatomic) UIImageView *logoIV;
@property (strong, nonatomic) UILabel *titileL;
@property (strong, nonatomic) UIImageView *lineIV;

@end

@implementation GoodsLogisticsFirstTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        
        [self.contentView addSubview:self.logoIV];
        [self.contentView addSubview:self.titileL];
        [self.contentView addSubview:self.lineIV];
    }
    
    return self;
}


- (void)layoutSubviews {
    
    [super layoutSubviews];
    
    __weak typeof(self) weakSelf = self;
    [self.logoIV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(weakSelf.contentView.mas_left).with.offset(jisuan(40));
        make.centerY.mas_equalTo(weakSelf.contentView.mas_centerY);
        make.width.mas_equalTo(jisuan(36));
        make.height.mas_equalTo(jisuan(36));
        
    }];
    [self.titileL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.logoIV.mas_right).with.offset(jisuan(10));
        make.centerY.mas_equalTo(weakSelf.contentView.mas_centerY);
    }];
    [self.lineIV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.contentView.mas_left);
        make.right.mas_equalTo(weakSelf.contentView.mas_right);
        make.bottom.mas_equalTo(weakSelf.contentView.mas_bottom);
        make.height.mas_equalTo(jisuan(4));
    }];
    
}

#pragma mark -lazy
- (UIImageView *)logoIV {
    
    if (!_logoIV) {
    
        _logoIV = [[UIImageView alloc] init];
        _logoIV.contentMode = UIViewContentModeScaleAspectFit;
        _logoIV.image = [UIImage imageNamed:@"goodsInformationLogoBG"];
    }
  
    return _logoIV;
    
}

- (UILabel *)titileL {
    
    if (!_titileL) {
        
        _titileL = [[UILabel alloc] init];
        _titileL.textAlignment = NSTextAlignmentLeft;
        _titileL.font = Font(20);
        
        NSString *str = @"本条数据由爱淘帮提供";
        NSMutableAttributedString *attributeStr = [[NSMutableAttributedString alloc] initWithString:str];
        [attributeStr addAttribute:NSForegroundColorAttributeName value:Color333333 range:NSMakeRange(0, 5)];
        [attributeStr addAttribute:NSForegroundColorAttributeName value:Colorff4200 range:NSMakeRange(5, 3)];
        [attributeStr addAttribute:NSForegroundColorAttributeName value:Color333333 range:NSMakeRange(8, 2)];
        _titileL.attributedText = attributeStr;
    }
    
    return _titileL;
}

- (UIImageView *)lineIV {
    
    if (!_lineIV) {
        
        _lineIV = [[UIImageView alloc] init];
        _lineIV.contentMode = UIViewContentModeScaleAspectFit;
        _lineIV.image = [UIImage imageNamed:@"goodsInfromatiionLineBG"];
        
    }

    return _lineIV;
}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
